<!-- 巡检管理-添加巡检计划 -->
<template>
  <div>
    <el-dialog :visible.sync="dialogVisible" :before-close="handleCloseBindWarnStandard" :close-on-click-modal="false" title="预览" width="800px" class="noMargin planColor">
      <div class="date">日期：{{ currentDate }}</div>
      <div class="table">
        <div class="title">{{ dialogForm.name }}</div>
        <ul v-for="(item, index) in dialogForm.data" :key="index" :style="{ height: 40* item.length + 'px' }" class="list">
          <li :style="{ height: 40* item.length + 'px', 'line-height': 40* item.length + 'px' }">{{ item.name }}</li>
          <!-- <li><span>外观是否完好</span><span>压力（MPa）</span><span>能否启动</span></li> -->
          <li :style="{ height: 40* item.length + 'px' }">
            <span v-for="(data, i) in item.list" :key="i">
              {{ data }}
            </span>
          </li>
          <li :style="{ height: 40* item.length + 'px' }">
            <span v-for="(data, i) in item.list" :key="i"/>
          </li>
        </ul>
        <div class="remarks">备注：</div>
        <ul class="other">
          <li>检查人签字：XXX</li>
          <li>负责人签字：XXX</li>
        </ul>
      </div>
    </el-dialog>
  </div>
</template>
<script>
// import { usersAdd } from '@/api/users'
import { parseTime } from '@/utils/index'
export default {
  props: {
    dialogForm: {
      type: Object,
      default: () => {
        return {}
      }
    },
    dialogVisible: {
      type: Boolean,
      default: () => {
        return false
      }
    }
  },
  data() {
    return {
      currentDate: parseTime(new Date().getTime(), '{y}-{m}-{d}')
    }
  },
  watch: {
    dialogVisible(val) {
      if (val) {
        console.log(JSON.stringify(this.dialogForm))
      }
    }
  },
  methods: {
    // 关闭弹窗，不可以删这个方法。不用这个方法点击遮罩层关闭会报错
    handleCloseBindWarnStandard() {
      this.$emit('closeBindWarnStandard')
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.date{
    width: 100%;
    height:30px;
    line-height: 30px;
    text-align: right;
    padding-right: 30px;
    box-sizing: border-box;
}
.table{
  width:100%;
  border: 1px solid #aaaaaa;
  border-radius: 3px;
  margin-bottom: 10px;
  .title{
    height: 40px;
    line-height: 40px;
    text-align: center;
    color: #7F7E7E;
    font-weight: 600;
    border-bottom: 1px solid #dcdcdc;
  }
  .list{
    border-bottom: 1px solid #dcdcdc;
    height: 120px;
    li{
      float: left;
      height: 120px;
      text-align: center;
      color: #7F7E7E;
      font-weight: 600;
      span{
        display: block;
        height: 40px;
        line-height: 40px;
        border-bottom: 1px solid #dcdcdc;
      }
      span:last-child{
        border-bottom: none;
      }
    }
    li:first-child{
      width: 20%;
      height: 120px;
      line-height: 120px;
      border-right: 1px solid #dcdcdc;
    }
    li:nth-child(2){
      width: 20%;
      border-right: 1px solid #dcdcdc;
    }
    li:nth-child(3){
      width: 60%;
    }
  }
  .remarks{
    width: 100%;
    height: 100px;
    border-bottom: 1px solid #dcdcdc;
    padding: 20px;
    color: #7F7E7E;
    font-weight: 600;
  }
  .other{
    width: 100%;
    height: 100px;
    color: #7F7E7E;
    font-weight: 600;
    li{
      padding: 20px;
      float: left;
      height: 100px;
    }
    li:first-child{
      width: 45%;
      border-right: 1px solid #dcdcdc;
    }
    li:nth-child(2){
      width: 55%;
    }
  }
}
</style>
